package com.song.weektest.domain;

import lombok.Data;

/**
 * @author TonySong
 * @date 2024/5/29 0029
 * @time 16:39
 */
@Data
public class R<T>{

     private Integer code;
     private String msg;
     private T data;

     public static <T> R<T> success(T data){
          R<T> r = new R<>();
          r.setCode(200);
          r.setData(data);
          return r;
     }

     public static <T> R<T> error(Integer code,String msg){
          R<T> r = new R<>();
          r.setCode(code);
          r.setMsg(msg);
          return r;
     }

}
